# nginx 镜像
FROM nginx:latest

# 删除原有配置文件
RUN rm /etc/nginx/conf.d/default.conf \
&& mkdir -p /usr/share/nginx/html/static \
&& mkdir -p /usr/share/nginx/html/media \
&& mkdir -p /usr/share/nginx/ssl

# 设置时区的环境变量
ENV TZ Asia/Shanghai
# root 权限
USER root

# 添加配置文件
ADD ./nginx.conf /etc/nginx/conf.d/

# 开发端口
EXPOSE 80

# 关闭守护模式
CMD ["nginx", "-g", "daemon off;"]

# sudo docker run -it -p 81:80 -v /Users/yu/work/UniData2022/20220606-兴村共富-词云图-相似度/UnidtModel/static:/usr/share/nginx/html/static -v /Users/yu/work/UniData2022/20220606-兴村共富-词云图-相似度/UnidtModel/media:/usr/share/nginx/html/media -v /Users/yu/work/UniData2022/20220606-兴村共富-词云图-相似度/UnidtModel/compose/nginx/log:/var/log/nginx/log -d nginx-xingcungongfu:v2
# sudo docker run -it -p 8000:8000 -v /Users/yu/work/UniData2022/20220606-兴村共富-词云图-相似度/UnidtModel/db:/var/www/html/unidtProject/db -d unidt-xingcungongfu:v2